{ INFORMATICS.MCCME.RU
  Problem statement: http://informatics.mccme.ru/moodle/mod/statements/view3.php?chapterid=260
  Verdict: Accepted
}
uses SysUtils, Math;
 
var
	a,b:int64;
 
begin
reset(input,'input.txt');
rewrite(output,'output.txt');
read(a,b);
if (a=0) and (b=0) then write('INF') else
if a=0 then write('NO') else 
if (abs(b) mod abs(a)>0) or (a=0) then write('NO') else write(-b div a);
end.